<!--页面主要内容-->
<main class="lyear-layout-content">
    <div class="container-fluid p-t-15">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <form method="post" class="row">
                            <div class="form-group col-md-12">
                                <label for="level">会员等级</label>
                                <input type="text" class="form-control" data-proid="{$Product['id']}" id="level" value="{$Vip['level']}" name="level" placeholder="请输入会员等级" />
                            </div>
                            <div class="form-group col-md-12">
                                <label for="price">等级价格</label>
                                <input type="text" class="form-control" id="price" name="price" value="{$Vip['price']}"
                                    placeholder="请输入等级价格" />
                            </div>
                            <div class="form-group col-md-12">
                                <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确
                                    定</button>
                                <button type="button" class="btn btn-default"
                                    onclick="javascript:history.back(-1);return false;">返 回</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<!--End 页面主要内容-->
<script>
    $('#level').change(function () {
        var level = $(this).val();
        var proid = $(this).data('proid')
        $.ajax({
            // 提交方式
            type: 'POST',
            // 请求地址
            url: `{:url('admin/vip/select')}`,
            data: {
                level,
                proid
            },
            // 请求返回的数据类型 text html json
            dataType: 'json',
            success: (result) => {
                if (result.code === 0) {
                    $.notify({
                        message: result.msg,
                    }, {
                        delay: 1000,
                        type: 'warning'
                    })
                }
            }
        })
    })
</script>